//
//  EzText.h
//  EzTools
//
//  Created by 刘跃龙 on 11/9/15.
//  Copyright © 2015 Frank He. All rights reserved.
//

#ifndef EzText_h
#define EzText_h

#include <string>
#include <vector>
#include <map>
#include "EzTools.h"

class EzText
{
public:
    static std::string genNumberPassword(int len);
    static std::string genCharacterAndNumberPassword(int len);
    static std::string StringToHexString(std::string str);
    static std::string HexStringtoString(std::string str);
    static std::string trim(std::string str,std::string pattern = " ");
    static std::vector<std::string> split(std::string str, std::string pattern);
    static std::string strRemove(std::string str,char ch);
    static std::string uint16ToNetworkString(uint16_t value);
    static std::string uint32ToNetworkString(uint32_t value);
    static uint16_t networkCharPointToUint16(char* buf,size_t offset);
    static uint32_t networkCharPointToUint32(char* buf,size_t offset);
    static uint16_t networkStringPointToUint16(std::string buf,size_t offset);
    static uint32_t networkStringPointToUint32(std::string buf,size_t offset);
};

EZ_BEGIN

long getTimestmap(long offset = 0);
long long getMillTimestmap(long long offset = 0);
std::string getTimestmapString();
std::string getGMTTimestmapString();
std::string getTimestmapString(std::string format);
std::string getGMTTimestmapString(std::string format);
std::string getTimestmapString(std::string format,long timestmap);
std::string getGMTTimestmapString(std::string format,long timestmap);
std::string getTimestmapString(std::string format,long long millTimestmap);
std::string getGMTTimestmapString(std::string format,long long millTimestmap);

EZ_END

#endif /* EzText_h */
